package com.hqyj.springboot.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hqyj.springboot.entity.Users;

import java.util.List;

public interface UsersService extends IService<Users> {

    //规定一下，凡是以insert/modify/remove/query开头属于mybatis实现的接口

    //新增单个用户
    public boolean insertUser(Users u) throws Exception;

    //批量新增用户
    public boolean insertBatchUsers(List<Users> usersList) throws Exception;

    //更新用户
    public boolean modifyUsers(Users u) throws Exception;

    //查询单个用户
    public Users queryUserByUid(Integer uid) ;

    //查询所有用户
    public List<Users> queryAllUsers();

    //删除单个用户
    public boolean removeUser(Integer uid) throws Exception;


    //获得分页数据
    public IPage<Users> queryUsersPager(int currentPageIndex);


    public boolean removeBatch(List<Integer> uidList) throws Exception;

    //规定一下，凡是以save/update/find/delete开头属于JPA

    //新增单个用户对象。
    public boolean saveUser(Users u) throws Exception;

    //批量新增用户资料
    public boolean saveBatchUsers(List<Users> usersList) throws Exception;

    //查询单个用户
    public Users findUserByUid(Integer uid);

    //查询所有用户
    public List<Users> findAllUsers();

    //更新单个用户
    public boolean updateUser(Users u) throws Exception;

    //删除单个用户
    public boolean deleteUser(Integer uid) throws Exception;

}
